home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / getn / getnet2.sub < prev   
Text File  |  1996-07-10  |  5KB  |  74 lines

  1.         ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2.         ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3.         ':::                                                                 :::
  4.         ':::    PROGRAM:        GETNET2.SUB                                  :::
  5.         ':::    AUTHOR:         Mike Shaffer                                 :::
  6.         ':::    DATE:           Feb 2, 1991                                  :::
  7.         ':::    VERSION:        2.0                                          :::
  8.         ':::    PURPOSE:        Returns both Novell connection # and         :::
  9.         ':::                    network physical address to a QuickBASIC     :::
  10.         ':::                    program.                                     :::
  11.         ':::    REVISIONS:                                                   :::
  12.         ':::                                                                 :::
  13.         ':::                                                                 :::
  14.         ':::                                                                 :::
  15.         ':::    NOTES:          This SUB assumes you're using PDQ from       :::
  16.         ':::                    Crescent Software. If not (shame on you!)    :::
  17.         ':::                    than you can modify the interrupt call to    :::
  18.         ':::                    use INT86 as provided with QuickBASIC.       :::
  19.         ':::                                                                 :::
  20.         ':::                                                                 :::
  21.         ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  22.         ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  23.         '                                       '
  24.         '                                       '
  25.         sub GETNET2(conn%,address$) static
  26.         '                                       '
  27.         dim regs as regtype                     ' Create type to hold registers
  28.         '                                       ' NOTE: regtype is defined in
  29.         '                                       '       the PDQ declarations
  30.         '                                       '       include. If you're not
  31.         '                                       '       using PDQ, you'll
  32.         '                                       '       probably want to use
  33.         '                                       '       INT86 as provided by
  34.         '                                       '       QuickBASIC, in which
  35.         '                                       '       case the interrupt
  36.         '                                       '       control structure will
  37.         '                                       '       be an integer array.
  38.         '                                       '       (see the QB docs)
  39.         '                                       '
  40.         '                                       '
  41.         regs.ax = &hDC00                        ' AH=&hDC, AL=&h00
  42.         '                                       '   Function to get connection#
  43.         interrupt &h21,regs                     ' So we get it! (returned in AL)
  44.         conn% = regs.ax and &hFF                '
  45.         '                                       '
  46.         '                                       '
  47.         regs.ax = &hEE00                        ' AH=&hEE, AL=&h00
  48.         '                                       '   Function to get address
  49.         interrupt &h21,regs                     ' So we get it! (returned in
  50.         '                                       '  AX/BX/CX
  51.         '                                       '
  52.         '                                       '
  53.         '                                       ' NOTE: I have chosen to 
  54.         '                                       '       return the connection
  55.         '                                       '       # in the form of a
  56.         '                                       '       HEX string. You may
  57.         '                                       '       modify to return it
  58.         '                                       '       as a long integer.
  59.         '                                       '
  60.         '                                       '       (didn't really need
  61.         al = (regs.aX and &hFF)                 '        to split apart here,
  62.         ah = (regs.aX and &hFF00)\256           '        but did in case you
  63.         bl = (regs.bX and &hFF)                 '        want to reassemble
  64.         bh = (regs.bX and &hFF00)\256           '        into a long integer!)
  65.         cl = (regs.cX and &hFF)                 '
  66.         ch = (regs.cX and &hFF00)\256           '
  67.         '                                       '
  68.         address$ = hex$(ch) + hex$(cl) +_       '
  69.                    hex$(bh) + hex$(bl) +_       '
  70.                    hex$(ah) + hex$(al)          '
  71.         '                                       '
  72.         end sub
  73. 
  74.